package bpm.dao.impl.proposal;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;

import org.springframework.jdbc.core.BatchPreparedStatementSetter;

import bpm.domain.proposal.ProposalEntry;

public class ProposalEntryBatchPreparedStatementSetter implements BatchPreparedStatementSetter  {
	private List<ProposalEntry> ProposalEntrys;
	public ProposalEntryBatchPreparedStatementSetter(List<ProposalEntry> ProposalEntrys){
		this.ProposalEntrys=ProposalEntrys;
	}
	public int getBatchSize() {
		return ProposalEntrys.size();
	}
	public void setValues(PreparedStatement ps, int i) throws SQLException {
		ps.setString(1, ProposalEntrys.get(i).getId());
		ps.setString(2, ProposalEntrys.get(i).getProposalId());
		ps.setString(3, ProposalEntrys.get(i).getFieldKey());
		ps.setString(4, ProposalEntrys.get(i).getValue());
		ps.setTimestamp(5,new java.sql.Timestamp(ProposalEntrys.get(i).getCreateTime().getTime()));
		ps.setTimestamp(6, new java.sql.Timestamp(ProposalEntrys.get(i).getLastUpdateTime().getTime()));
		ps.setString(7, ProposalEntrys.get(i).getDescription());
		 
	}
}
